package Game;

import java.awt.event.KeyEvent;


public class PlayerGradius extends PlayerArkanoid
{
	private static final long serialVersionUID = 2L;
	//private boolean move_up;
	//private boolean move_down;
	private boolean move_right;
	private boolean move_left;
	
	private float speed;
	
	public PlayerGradius(float x, float y, int w, int h)
	{
		super(x, y, w, h);
		move_left = false;
		move_right = false;
		//move_up = false;
		//move_down = false;
	}
	
	public void Update(InputManager input)
    {
		if (input.ChecarTecla(KeyEvent.VK_LEFT))
    		move_left = true;
		else
			move_left = false;
    	
		if (input.ChecarTecla(KeyEvent.VK_RIGHT))
    		move_right = true;
		else
			move_right = false;
    	
		if (input.ChecarTecla(KeyEvent.VK_UP))
			if(y > 0)
    			this.y+= speed;
    	
		if (input.ChecarTecla(KeyEvent.VK_DOWN))
    		if(y < 600 + w)
    			this.y-= speed;
    	
		if (input.ChecarTecla(KeyEvent.VK_SPACE))
    		ShotManagerGradius.Add(x+w, y+(h/2), false);
		
		if (move_left)
				this.x -= 3;
			
		if (move_right)
			this.x += 3;

	}
}
